{extend name="Layout/datagrid" /}
{block name="content_header"}        
<h1>
    开放登录
    <small>advanced tables</small>
</h1>
<ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
    <li><a href="#">系统</a></li>
    <li class="active">开放登录</li>
</ol>
{/block}
{block name="content"}
<div class="box">
    <div class="box-header">
        <ul class="nav nav-tabs">
            {foreach name="tabs" item="vo"}
            <li class="{$vo.active}"><a href="{:url($vo['url'])}">{$vo.title}</a></li>
            {/foreach}
        </ul>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <div class="row">
            <div class="col-md-5">
                <!-- form start -->
                <form action="{:url('editSave')}" method="post" enctype="multipart/form-data" class="form-horizontal">
                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">启用状态</label>
                            <div class="col-sm-9">
                                {xshtml:radio name="status" data='array("1"=>"启用","0"=>"停用")' value="data['status']|default='1'" /}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">网站验证</label>
                            <div class="col-sm-9">
                                <input type="text" name="verification" class="form-control input-sm" placeholder="网站验证" value="{$data.verification}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">AppID</label>
                            <div class="col-sm-9">
                                <input type="text" name="client_id" class="form-control input-sm" placeholder="AppID" value="{$data.client_id}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">AppSecret</label>
                            <div class="col-sm-9">
                                <input type="text" name="client_secret" class="form-control input-sm" placeholder="AppSecret" value="{$data.client_secret}" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">自动登录</label>
                            <div class="col-sm-9">
                                {xshtml:radio name="auto_login" data='array("1"=>"打开","0"=>"关闭")' value="data['auto_login']|default='1'" /}
                            </div>
                        </div>
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <a class="btn btn-default" href="{:url('Help/oauth_wechat')}" target="_blank">帮助？</a>
                        <button type="submit" class="btn btn-primary pull-right">保存</button>
                    </div>
                    <!-- /.box-footer -->
                    <input type="hidden" name="id" value="{$data.id}"/>
                </form>
            </div>
        </div>
    </div>
    {/block}
    {block name="script_before"}
    <script>
        xsApp.xsfnUploadButtonInit();
        /**
         * 单文件上传回调函数
         * @param {type} name
         * @param {type} value
         * @returns {undefined}
         * @version 1.0 2016-12-15
         */
        function single_uploader_cb(name, value) {
            var $input = $('[name="' + name + '"]');
            $input.val(value)
            //$input.parent().parent().find('img').attr('src', value).parent().attr({'href': value, 'title': value}).next().data('url', value);
            layer.closeAll();
            //$('iframe').parent().dialog('close');
        }
    </script>
    {/block}